/**
 * Created by Administrator on 2016/7/26.
 */
var h11 = document.querySelector('nav  .nav-o .nav-h .h1 .h11');
var h111 = document.querySelector('nav  .nav-o .nav-h .h1 .h111');
var shop12 = document.querySelector('nav  .nav-o .nav-h .h1 .shop12');
var shop13 = document.querySelector('nav  .nav-o .nav-h .h1 .shop13');
h11.addEventListener('mouseover',function(){
    h111.style.display = 'block';
    h111.style.background = '#fff';
});
h11.addEventListener('mouseout',function(){
    h111.style.display = 'none';
});
h111.addEventListener('mouseover',function(){
    h111.style.display = 'block';
});
h111.addEventListener('mouseout',function(){
    h111.style.display = 'none';
});
shop12.addEventListener('mouseover',function(){
    shop12.style.background = '#f7f7f7';
});
shop12.addEventListener('mouseout',function(){
    shop12.style.background = 'white';
});
shop13.addEventListener('mouseover',function(){
    shop13.style.background = '#f7f7f7';
});
shop13.addEventListener('mouseout',function(){
    shop13.style.background = 'white';
});

//滚动的下拉弹出框
var hl11 = document.querySelector('nav .sticky-search-container .nav-o .nav-h .h1 .h11');
var hl111 = document.querySelector('nav .sticky-search-container .nav-o .nav-h .h1 .h111');
var shopl12 = document.querySelector('nav .sticky-search-container .nav-o .nav-h .h1 .shop12');
var shopl13 = document.querySelector('nav .sticky-search-container .nav-o .nav-h .h1 .shop13');
hl11.addEventListener('mouseover',function(){
    hl111.style.display = 'block';
    hl111.style.background = '#fff';
});
hl11.addEventListener('mouseout',function(){
    hl111.style.display = 'none';
});
hl111.addEventListener('mouseover',function(){
    hl111.style.display = 'block';
});
hl111.addEventListener('mouseout',function(){
    hl111.style.display = 'none';
});
shopl12.addEventListener('mouseover',function(){
    shopl12.style.background = '#f7f7f7';
});
shopl12.addEventListener('mouseout',function(){
    shopl12.style.background = 'white';
});
shopl13.addEventListener('mouseover',function(){
    shopl13.style.background = '#f7f7f7';
});
shopl13.addEventListener('mouseout',function(){
    shopl13.style.background = 'white';
});


// 右侧弹出框   导航下拉框
//位置监听
setInterval(function(){
    var x = $(document).scrollTop();
    console.log(x);
    var y = $(document).scrollTop();
    if(x > 350){
        $('.mgj-back2top').css('display','block');
    }else{
        $('.mgj-back2top').css('display','none');
    }
    if(y > 650){
        $('.sticky-search-container').css('display','block');
    }else{
        $('.sticky-search-container').css('display','none');
    }
});

